package cn.tedu.tmall.front.account.pojo.param;

import cn.tedu.tmall.common.validation.account.UserRules;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户注册的参数类
 *
 * @author java@tedu.cn
 * @version 3.0
 */
@Data
public class UserRegisterParam implements Serializable, UserRules {

    /**
     * 用户名
     */
    @NotNull(message = MESSAGE_USERNAME_NOT_NULL)
    @Pattern(regexp = PATTERN_USERNAME, message = MESSAGE_USERNAME_PATTERN)
    @ApiModelProperty(value = "用户名", required = true, example = "student")
    private String username;

    /**
     * 密码（原文）
     */
    @NotNull(message = MESSAGE_PASSWORD_NOT_NULL)
    @Pattern(regexp = PATTERN_PASSWORD, message = MESSAGE_PASSWORD_PATTERN)
    @ApiModelProperty(value = "密码", required = true, example = "123456")
    private String password;

    /**
     * 头像URL
     */
    @ApiModelProperty(value = "头像URL")
    private String avatar;

    /**
     * 手机号码
     */
    @NotNull(message = MESSAGE_PHONE_NOT_NULL)
    @Pattern(regexp = PATTERN_PHONE, message = MESSAGE_PHONE_PATTERN)
    @ApiModelProperty(value = "手机号码", required = true, example = "13800138008")
    private String phone;

    /**
     * 电子邮箱
     */
    @NotNull(message = MESSAGE_EMAIL_NOT_NULL)
    @Pattern(regexp = PATTERN_EMAIL, message = MESSAGE_EMAIL_PATTERN)
    @ApiModelProperty(value = "电子邮箱", required = true, example = "student@tedu.cn")
    private String email;

}
